﻿@model dynamic
@{
    
}

<div id="tb">
    <div class="t-toolbar">
        <a id="a_add" href="#" plain="true" class="easyui-linkbutton" icon="fa fa-check" title="保存" onClick="saveClick()">保存</a>
        <a id="a_del" href="#" plain="true" class="easyui-linkbutton" icon="fa fa-times" title="关闭" onClick="cancelClick()">关闭</a>
    </div>
</div>
<form id="frmMenu" method="post" action="/sys/menu/editajax" class="easyui-form">
    <input type="hidden" name="menu_id" value="@Model.data.menu_id" />
    <table>
        <tr>
            <td>父菜单</td>
            <td><input class="easyui-combotree" data-options="url:'/sys/Menu/GetMenuTreeDS',method:'get',showNullItem:true" style="width:100%" name="parent_id" value="@Model.data.parent_id" /></td>
        </tr>
        <tr>
            <td><label for="name">菜单名:</label></td>
            <td><input class="easyui-textbox" type="text" name="name" data-options="required:true" value="@Model.data.name" /></td>
        </tr>
        <tr>
            <td><label for="iconCls">图标:</label></td>
            <td>
                <input class="easyui-comboico" name="icon" value="@Model.data.icon" data-options="
                    showItemIcon: true,
                    url:'/sys/icon/comboDs',
                    editable: true,panelWidth:'700px',
                    panelHeight: 'auto', panelMaxHeight:'500px'  " />
            </td>
        </tr>
        <tr>
            <td><label for="url">链接:</label></td>
            <td><input class="easyui-textbox" type="text" name="url" value="@Model.data.url" /></td>
        </tr>
        <tr>
            <td><label for="url">排序:</label></td>
            <td><input class="easyui-textbox" type="text" name="sort" value="@Model.data.sort" /></td>
        </tr>
    </table>

</form>
<script type="text/javascript">
        function closeClick() {
            sx.winClose({sucess:true});
        }
        function cancelClick() {
            sx.winCancel();
        }
        function saveClick() {
            $('#frmMenu').form('submit', {
                onSubmit: function(){
		            // do some check
		            // return false to prevent submit;
                },
                success: function (data) {
                    var data = eval('(' + data + ')');
                    if (data.resultCode == sx.resultCode.ok) {

                        sx.success("保存成功！", function () { closeClick(); });
                        sx.top.InitLeftMenu();
                    } else {
                        sx.error(data.info);
                    }
                }
            });
        }
</script> 